home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ian & Stuart's Australian Mac: Not for Sale
/
Another.not.for.sale (Australia).iso
/
fade into you
/
getting there
/
Apps
/
AuthMan 1.0.8
/
AuthMan XCMD
/
authLibrary.h
< prev
next >
Wrap
Text File
|
1994-05-06
|
5KB
|
119 lines
/*
* Copyright (c) 1992-1994 Regents of The University of Michigan.
* All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appears in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation, and that the name of The University
* of Michigan not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. This software is supplied as is without expressed or
* implied warranties of any kind.
*
* Campus Computing Sites, Sales, and Service
* The University of Michigan
* c/o Robert John Churchill
* 535 W. William Street
* Ann Arbor, Michigan
* +1-313-936-2528
* rjc@ccs.itd.umich.edu
*/
#include <Types.h>
#pragma once
#define AUTHMAN_DRVR_NAME "\p.AuthMan 1" /* driver name */
#define AUTHMAN_VERSION_CODE 3 /* current version */
#define gestaltAuthManVersion 'UMAM'
#define AUTHENTICATE_NOW 128 /* AuthMan v1 csCodes */
#define GET_AUTH_STATUS 129
#define SHOW_MESSAGE 130
#define GET_UNIQNAME 131
#define FLUSH_TICKETS 132
#define GET_AUTH_VERSION 133
#define RELOAD_INFO 134
#define SET_UNIQNAME 135
#define GET_LOCAL_REALM 256
#define GET_V4_TICKET 1024 /* AuthMan v2 additional csCodes */
#define EXPIRE_V4_TICKET 1025
#define GET_V4_TICKET_N_INFO 1026
#define GET_REALM_N_INFO 1027
#define GET_REALM_HOST_N_INFO 1028
#define DES_FUNCTIONS 1029
#define SET_V4_PASSWORD 1050 /* AuthMan v3 additional csCodes */
#define AUTH_MSG_CALLBACK 1051
typedef struct _V4ticketInfo {
Str63 sName,sInstance,sRealm; /* service ticket info */
Str63 pName,pInstance,pRealm; /* principal of service ticket info */
long issueDate,expireDate; /* in Macintosh time */
unsigned char sessionKey[8];
} _V4ticketInfo,*_V4ticketInfoPtr;
#define MAX_KTXT_LEN 1250 /* maximum Kerberos packet size (re: getV4Ticket) */
#define INFINITE_LIFETIME 0xFFFFFFFF /* request an infinite lifetime */
#define UNKNONW_REALM_TYPE 0 /* Realm codes */
#define UNKNOWN_REALM_TYPE 0 /* typo: oops */
#define MIT_KERBEROS_REALM_TYPE 1
#define AFS_KERBEROS_REALM_TYPE 2
/* DES operation modifier*/
#define DES_DECRYPT 0 /* "or" with DES operations below */
#define DES_ENCRYPT 1
/* DES operation type */
#define DES_PCBC 0
#define DES_SCHED 2
#define DES_ECB 4
#define DES_QUAD_CKSUM 6
/* getV4Ticket flags */
#define DONT_PROMPT_FLAG 0x0000
#define PROMPT_FLAG 0x0001 /* bit 0 set */
/* doMsgCallback flags */
#define MSG_REGISTER 0x0000
#define MSG_DEREGISTER 0x0001
#define MSG_REGISTER_MENU 0x0002
/* prototype for callback function */
/* note: always return noErr */
typedef pascal OSErr
(*doAuthMsgCallbackProc)(short messageID,_V4ticketInfo *,long userData);
/* callback messageIDs */
#define AUTH_MSG_V4TICKETADDED 0x0001
#define AUTH_MSG_V4TICKETEXPIRED 0x0002
#define AUTH_MSG_MENUITEM_SELECTED 0x0003
#define AUTH_RELOAD_CONFIG_INFO 0x0004
/* AuthMan v1 prototypes */
pascal OSErr openAuthMan(short *refNum,short *version);
pascal OSErr getDefaultRealm(short refNum,Str255 *realmName,short *realmType);
pascal OSErr getAuthenticationStatus(short refNum,short *status);
pascal OSErr getUniqname(short refNum,Str255 *uniqName);
pascal OSErr setUniqname(short refNum,Str255 *uniqName);
/* AuthMan v2 additional prototypes */
pascal OSErr reloadDrvrInfo(short refNum);
pascal OSErr getV4Ticket(short refNum,void *ticketStorage,short *ticketLen, \
Str255 *sName,Str255 *sInstance,Str255 *sRealm, \
long lifetimeInSecs,short flag);
pascal OSErr expireV4Ticket(short refNum,Str255 *sName,Str255 *sInstance,Str255 *sRealm);
pascal OSErr getV4TicketNinfo(short refNum,short ticketNum,_V4ticketInfo *);
pascal OSErr getRealmNinfo(short refNum,short realmNum,Str255 *realmName, \
short *AFSflag,short *numHosts);
pascal OSErr getRealmHostNinfo(short refNum,short realmNum,short hostNum, \
Str255 *hostName,short *portNum);
/* AuthMan v3 additional prototypes */
pascal OSErr doDES(short refNum,short operation,void *sessionKey, \
void *buffer,long bufferLen);
pascal OSErr setV4Password(short refNum,Str255 *pName,Str255 *pInstance,Str255 *pRealm);
pascal OSErr doMsgCallback(short refNum,short callbackOperation, \
doAuthMsgCallbackProc callbackRtn,long callbackMiscData,long userData);